<template>
  <el-container>
    <el-main>
      <el-container class="parent-body">
        <el-header class="content-header">
          关键词排行
          <div class="rightTop">
            <el-button @click="OutData()">导出数据</el-button>
          </div>
        </el-header>
        <el-main class="info-main padding-style">
          <el-table :data="tableData" border style="width: 100%">
            <el-table-column prop="goodName" label="商品名称"></el-table-column>
            <el-table-column prop="result" label="结果"></el-table-column>
            <el-table-column prop="allSearch" label="总搜索"></el-table-column>
            <el-table-column prop="thisMouth" label="本月"></el-table-column>
            <el-table-column prop="thisWeek" label="本周"></el-table-column>
            <el-table-column prop="today" label="今日"> </el-table-column>
            <el-table-column label="操作" width="200">
              <template slot-scope="scope">
                <el-button
                  size="mini"
                  @click="look(scope.$index, tableData)"
                  type="text"
                  >查看</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </el-main>
        <el-footer class="info-foot">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage4"
            :page-sizes="[10, 20, 50, 100]"
            :page-size="500"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400"
          >
          </el-pagination>
        </el-footer>
      </el-container>
    </el-main>
  </el-container>
</template>
<script>
export default {
  data() {
    return {
      // 分页
      currentPage4: 1,
      tableData: [
        {
          goodName: "内衣",
          result: "1000",
          allSearch: "1000",
          thisMouth: "100",
          thisWeek: "10%",
          today: "10"
        },
        {
          goodName: "内衣",
          result: "1000",
          allSearch: "1000",
          thisMouth: "100",
          thisWeek: "10%",
          today: "10"
        },
        {
          goodName: "内衣",
          result: "1000",
          allSearch: "1000",
          thisMouth: "100",
          thisWeek: "10%",
          today: "10"
        },
        {
          goodName: "内衣",
          result: "1000",
          allSearch: "1000",
          thisMouth: "100",
          thisWeek: "10%",
          today: "10"
        }
      ]
    }
  },
  methods: {
    // 分页
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
    },
    look(index, row) {
      console.log(index, row)
    }
  }
}
</script>
<style scoped>
.rightTop {
  float: right;
}
.goodsrecycle-button-select-2 {
  height: 50px;
  padding-top: 10px;
  padding-left: 20px;
}
.select-width-1 {
  width: 220px;
}
.select-width-2 {
  width: 150px;
}
.centerTag {
  text-align: center;
}
.dateCss {
  float: left;
}
</style>
